package com.zx.mes.hyl.upms.controller;

import com.zx.mes.hyl.common.controller.BaseController;
import com.zx.mes.hyl.common.pagemodel.JsonResult;
import com.zx.mes.hyl.common.pagemodel.Menu;
import com.zx.mes.hyl.common.pagemodel.SessionInfo;
import com.zx.mes.hyl.upms.service.ResourceServiceI;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpSession;
import java.util.ArrayList;
import java.util.List;

/**
 * @author hyl
 * @date 2017-11-25
 */
@Controller
@RequestMapping("mainController")
public class MainController {

    @Value("${sessionInfoName}")
    private String sessionInfoName;

    @RequestMapping("/main")
    public String main(HttpSession session, Model model){
        SessionInfo sessionInfo = (SessionInfo) session.getAttribute(sessionInfoName);
        model.addAttribute("sessionInfo",sessionInfo);
        return "main";
    }


}
